From: Jonathan Dieter Date: Tue, 17 Apr 2018 10:54:51 +0000 (+0300) Subject: Fix off by one error X-Git-Tag: archive/raspbian/1.1.9+ds1-1+rpi1~1^2~314 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=0b4714474a5225a7d8b09fc6ada12b657445d81e;p=zchunk.git Fix off by one error --- diff --git a/src/lib/io.c b/src/lib/io.c index cdca83b..488ee19 100644 --- a/src/lib/io.c +++ b/src/lib/io.c @@ -78,7 +78,7 @@ int read_comp_size(int fd, size_t *val, size_t *length) { int i=0; for(char c=read_data(fd, data+i, 1); c < 128 && i < MAX_COMP_SIZE; i++,c=read_data(fd, data+i, 1)); - if(i == MAX_COMP_SIZE && data[i] < 128) { + if(i == MAX_COMP_SIZE) { zck_log(ZCK_LOG_ERROR, "Number too large\n"); *val = 0; return False;